#ifndef _EVENT_H_
#define _EVENT_H_

#include <string>
#include "SharedDef.h"

class Event{
public:
    Event(int eventId):m_eventId(eventId){}
    virtual std::string GetEventActionName(){
        return "";
    }
public:
    int m_eventId;
};

class UserEvent: public Event{
public:
    UserEvent(int eventId, std::string userName="玩家A"):Event(eventId),m_userName(userName){}
    virtual std::string GetEventActionName(){
        switch(m_eventId)
        {
            case PressEnterGameBtn:
                return "进入游戏";
            case PressLeaveGameBtn:
                return "离开游戏";
            case PressEnterGameRoom201Btn:
                return "进入201房间";
            case PressEnterGameRoom202Btn:
                return "进入202房间";
            case PressLeaveGameRoom201Btn:
                return "退出201房间";
            case PressLeaveGameRoom202Btn:
                return "退出202房间";
        }
    }
public:
    std::string m_userName;
};

class RoomEvent: public Event{
public:
    RoomEvent(int eventId):Event(eventId){
        switch(m_eventId)
        {
            case PressEnterGameRoom201Btn:
            case PressLeaveGameRoom201Btn:
                m_roomName = "房间201";
                break;
            case PressEnterGameRoom202Btn:
            case PressLeaveGameRoom202Btn:
                m_roomName = "房间202";
                break;
        }
    }
    virtual std::string GetEventActionName(){
        switch(m_eventId)
        {
            case PressEnterGameRoom201Btn:
                return "进入201房间";
            case PressEnterGameRoom202Btn:
                return "进入202房间";
            case PressLeaveGameRoom201Btn:
                return "退出201房间";
            case PressLeaveGameRoom202Btn:
                return "退出202房间";
        }
    }
public: 
    std::string m_roomName;
};

#endif